/*
 * Log.c
 *
 * Created: 30/04/2012 10:20:36
 *  Author: Dani
 */ 

#include <avr/io.h>
#define F_CPU 8000000
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lcd162.h"
#include "engine.h"
#include "switch.h"
#include "log.h"

uint8_t product_number = 200;
uint16_t weight = 8767;

int main(void)
{
	EngineInit();
	LCDInit();
	SwitchInit();
	sei();
	
	/*LCDDispInteger(LogRead(product_number));
	_delay_ms(1000);
   
	LCDGotoXY(0,1);*/

	while(1)
	{
		LCDClear();
		LCDDispInteger(LogRead(product_number));
		_delay_ms(2000);
	}
	return 0;
}
ISR(S1)
{
	LogWrite(product_number, weight);
}
ISR(S2)
{
	LogUpdate(product_number,6);
}